package main

import (
	"fmt"
	"gorm-study/src/pkg/student/models"
	"gorm-study/src/pkg/utils/dbutil"
)

func main() {
	email := "zhangsan@163.com"
	student := models.Student{
		Name:   "张三",
		Age:    18,
		Gender: true,
		Email:  &email,
	}
	result := dbutil.DB.Create(&student)

	fmt.Printf("生成的主键ID：%v \n", student.ID)
	fmt.Printf("插入的条数：%v \n", result.RowsAffected)
}
